package cn.shengongying.api.vo;

import cn.shengongying.model.Customer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * author: RXK
 * date: 2022/1/5 星期三
 * desc:
 */
@Getter
@Setter
@ApiModel(value = "雇主基本信息")
public class BossInfoVo extends BaseVo {

    private static final long serialVersionUID = 6519048954833876195L;


    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "签名")
    private String signature;

    @ApiModelProperty(value = "头像地址")
    private String img;

    @ApiModelProperty(value = "性别(0:男;1:女)")
    private Integer sex;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "生日(时间戳)")
    private Long birthday;

    @ApiModelProperty(value = "收货地址")
    private String address;

    @ApiModelProperty(value = "雇主类别(0:加工商;1:模具商;2:设备商)")
    private Integer category;

    @ApiModelProperty(value = "成立时间(时间戳)")
    private Long establishedTime;


    public static BossInfoVo build(Customer customer) {
        BossInfoVo vo = new BossInfoVo();
        vo.setId(customer.getId());
        vo.setSex(customer.getSex());
        vo.setImg(customer.getImg());
        vo.setNickName(customer.getNickName());
        vo.setSignature(customer.getSignature());
        vo.setPhone(customer.getPhone());
        vo.setCategory(customer.getCategory());
        vo.setBirthday(customer.getBirthday() != null ? customer.getBirthday().getTime() : null);
        vo.setAddress(customer.getAddress());
        vo.setEstablishedTime(customer.getEstablishedTime() != null ? customer.getEstablishedTime().getTime() : null);
        return vo;
    }
}
